package com.jwdf.uda.ui.adapter.viewholder;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.View;
import com.jwdf.uda.databinding.ItemReplyThumbLikeBinding;
import com.jwdf.uda.ui.activity.ReplyAnswerLikeActivity;
import com.jwdf.uda.ui.activity.UserInfoActivity;
import com.jwdf.uda.ui.adapter.AbsViewHolder;
import com.jwdf.uda.ui.adapter.item.ReplyDetailItem;
import com.jwdf.uda.view.LikeThumbnailView;

/**
 * Created by Administrator on 2016/10/14.
 */
public class ReplyThumbLikeViewHolder extends AbsViewHolder<ReplyDetailItem> {
    private ItemReplyThumbLikeBinding mItemBinding;

    public ReplyThumbLikeViewHolder(View convertView) {
        super(convertView);
        mItemBinding = DataBindingUtil.bind(convertView);
    }

    @Override
    protected void onBindView(final ReplyDetailItem item) {
        mItemBinding.viewLikeThumb.setMoreUserClickListener(new LikeThumbnailView.OnMoreUserClickListener() {
            @Override
            public void onClick(Context context) {
                ReplyAnswerLikeActivity.start(context, item.answerId);
            }
        });
        mItemBinding.viewLikeThumb.bindView(item.likeInfos, new LikeThumbnailView.OnUserAvatarClickListener() {
            @Override
            public void onClick(Context context, String userId, boolean isDesigner) {
                UserInfoActivity.start(context, userId, isDesigner);
            }
        });
    }

}
